import { showToast } from "utils/index";
Component({
  options: {
    styleIsolation: "apply-shared",
  },
  properties: {
    info: {
      type: Object,
      value: {},
    },
    list: {
      type: Array,
      value: [],
    },
    playInd: {
      type: Number,
      value: 0,
    },
  },

  data: {
    showLines: 9,
    maskStyle: "",
    height: "",
  },
  observers: {
    playInd(newVal) {
      this.setData({
        newPlayInd: newVal,
      });
    },
  },
  attached() {
    const { showLines, playInd } = this.data;
    this.setData({
      newPlayInd: playInd,
    });
    this.createSelectorQuery()
      .select(".list")
      .boundingClientRect()
      .exec((nodes) => {
        let { top, width, height } = nodes[0];
        this.setData({
          maskStyle: `top:${top}px;height:${height}px;width:${width}px;`,
          height: height / showLines,
        });
      });
  },
  methods: {},
});
